/**
 * @description 
 * @author cq
 * @Date 2021-04-06 15:36:30
 * @LastEditTime 2021-04-12 11:20:13
 * @LastEditors cq
 */
// import { applyMiddleware, createStore, combineReducers } from "redux"
import { createStore, applyMiddleware ,combineReducers} from "../kstore/index"
// import thunk from "redux-thunk"
// import logger from "redux-logger"
import { logger, thunk } from "../redux-applyMiddleware/index"


export const counterReucer = (state = 0, { type, payload = 1 }) => {
  switch (type) {
    case "ADD":
      console.log("enheng")
      return state + payload;
    case "MINUS":
      console.log(23444)
      return state - payload;
    default:
      return state;
  }
}

const store = createStore(
  combineReducers({ count: counterReucer }),
  applyMiddleware(thunk, logger)
)

export default store